<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<script src="./extend.js"></script>
<script>
    var object1 = {
        apple: 0,
        banana: {weight: 52, price: 100},
        cherry: 97
    };
    var object2 = {
        banana: {price: 200},
        durian: 100
    };

    var result = extend(object1, object2);

    console.log(result);

    var result2 = extend(true, object1, object2);
    console.log(result2);

    console.log(object1, object2);

</script>
</body>
</html>